package com.herenit.order_model.exception;

import com.herenit.order_model.enums.ExceptionEnums;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class MyException extends RuntimeException{

    private String code;

    private String message;

    public MyException(ExceptionEnums exceptionEnums){
        super(exceptionEnums.getMessage());
        this.code = exceptionEnums.getCode();
        this.message = exceptionEnums.getMessage();
    }
}
